import Vue from 'vue'
import Vuex from 'vuex'
import { getItem, setItem } from '@/utils/storage.js'
Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        user: getItem('current_user')
    },
    mutations: {
        setUser(state, user) {
            state.user = user
            setItem('current_user', user)
        }
    },
    actions: {},
    modules: {}
})
